<?php
class ControllerAccountCoupon extends Controller {

    private $error = array();

    public function index(){
        if (!$this->actionCheck(false,false)) {
            return;
        }
        $this->load->model('marketing/coupon');
        $data['coupons'] = array();
        $coupons = $this->model_marketing_coupon->getCoupons();
        foreach ($coupons as $coupon){
            $data['coupons'][] = array(
                'coupon_id' => $coupon['coupon_id'],
                'name'      =>$coupon['name'],
                'type'      =>$coupon['type'],
                'discount' => $coupon['discount'],
                'logged' => $coupon['logged'],
                'total' => $coupon['total'],
                'date_start' => $coupon['date_start'],
                'date_end' => $coupon['date_end'],
                'uses_total' => $coupon['uses_total'],
                'uses_customer' => $coupon['uses_customer'],
                'status' => $coupon['status'],
                'date_added' => $coupon['date_added']
            );
        }
        $this->response->setDataResult(1,"",$data);
    }
}